// -----------账号/手机切换的栏-----------
function aaa() {
    var zh = document.getElementById('land-box-a')
    var sj = document.getElementById('land-box-b')
    var b1 = document.getElementsByClassName('input')[0]
    var b2 = document.getElementsByClassName('ip')[0]
    var sp = document.getElementById('land-sp')
    zh.onclick = function () {
        // console.log(123);
        b1.style.display = 'block';
        b2.style.display = 'none';
        // zh.style.borderBottom = 'solid 2px blue'
        sj.style.borderBottom = 'none'
        sp.style.transition = 'all 0.6s'
        sp.style.left = '0'
        zh.style.color = '#409EFF'
        sj.style.color = 'black'
    }
    sj.onclick = function () {
        // console.log(123);
        b1.style.display = "none"
        b2.style.display = "block"
        zh.style.borderBottom = 'none'
        // sj.style.borderBottom = 'solid 2px blue'
        sp.style.transition = 'all 0.6s'
        sp.style.left = '175px'
        zh.style.color = 'black'
        sj.style.color = '#409EFF'
    }
}
aaa()
// ------------忘记密码------------
function bbb() {
    var bigBox = document.getElementsByClassName('big-ft-box')[0]
    var box = document.getElementsByClassName('big-ft-box')[0]
    // var ft = document.getElementById('forget');
    var wj = document.getElementsByClassName('wj')[0];
    var ftX = document.getElementsByClassName('ft-x')[0]
    var clsoe = document.getElementsByClassName('low-close')[0]

    var x = document.getElementsByClassName('cl-0-sp0')[0]
    var closeBox = document.getElementsByClassName('close-box')[0]
    var oNo = document.getElementsByClassName('cl-2-no')[0]
    var oYes = document.getElementsByClassName('cl-2-yes')[0]
    // var mm = document.getElementsById('wj');
    wj.onclick = function () {
        box.style.display = 'block'
    }
    ftX.onclick = function () {
        closeBox.style.display = 'block'
    }
    clsoe.onclick = function () {
        closeBox.style.display = 'block'
    }

    // bigBox.onclick = function(){
    //     closeBox.style.display = 'block'

    // }

    x.onclick = function () {
        bigBox.style.display = 'none'
    }
    oNo.onclick = function () {
        closeBox.style.display = 'none'
    }
    oYes.onclick = function () {
        bigBox.style.display = 'none'
        closeBox.style.display = 'none'
    }

}
bbb()
// --------------账号密码验证--------------
function ccc() {
    var iptDiv1 = document.getElementsByClassName('input-box')[0]
    var iptDiv2 = document.getElementsByClassName('input-box2')[0]
    var zhIpt = document.getElementsByClassName('inp1')[0]
    var pwd = document.getElementsByClassName('inp2')[0]
    var p1 = document.getElementsByClassName('p1')[0]
    var p2 = document.getElementsByClassName('p2')[0]
    var p11 = document.getElementsByClassName('p11')[0]
    var p111 = document.getElementsByClassName('p111')[0]
    var p22 = document.getElementsByClassName('p22')[0]
    var dl = document.getElementsByClassName('input-dl')[0]
    var myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;


    // dl.onclick = function () {
    zhIpt.onfocus = function () {
        iptDiv1.style.border = 'solid 1px blue'
    }
    zhIpt.onkeyup = function () {
        let zhIpt = document.getElementsByClassName('inp1')[0].value
        let zero = document.getElementsByClassName('zero')[0]
        if (zhIpt == '') {
            p1.style.display = 'block'
            iptDiv1.style.border = 'solid 1px red'
        } else {
            zero.innerHTML = zhIpt.length
        }
    }
    zhIpt.onblur = function () {
        let zhIpt = document.getElementsByClassName('inp1')[0].value
        if (zhIpt == '') {
            // console.log(111);
            p1.style.display = 'block'
            iptDiv1.style.border = 'solid 1px red'
        } else {
            p1.style.display = 'none'
            iptDiv1.style.border = 'solid 1px blue'
            if (zhIpt.length < 3) {
                p11.style.display = 'block'
                iptDiv1.style.border = 'solid 1px red'
            } else {
                p11.style.display = 'none'
                if (!myreg.test(zhIpt)) {
                    p111.style.display = 'block'
                    iptDiv1.style.border = 'solid 1px red'
                } else {
                    p111.style.display = 'none'
                    iptDiv1.style.border = 'solid 1px blue'
                }
            }
        }
        iptDiv1.style.border = 'solid 1px'
    }

    pwd.onfocus = function () {
        iptDiv2.style.border = 'solid 1px blue'
    }

    pwd.onblur = function () {
        let pwd = document.getElementsByClassName('inp2')[0].value
        if (pwd == '') {
            // console.log(111);
            p2.style.display = 'block'
            iptDiv2.style.border = 'solid 1px red'
        } else {
            p2.style.display = 'none'
            iptDiv2.style.border = 'solid 1px blue'
            if (pwd.length < 3) {
                p22.style.display = 'block'
                iptDiv2.style.border = 'solid 1px red'
            } else {
                p22.style.display = 'none'
                iptDiv2.style.border = 'solid 1px blue'
            }
        }
        iptDiv2.style.border = 'solid 1px'
    }
    dl.onclick = function () {
        let zhIpt = document.getElementsByClassName('inp1')[0].value
        let pwd = document.getElementsByClassName('inp2')[0].value

        if (zhIpt == 'admin' && pwd == '123456') {
            // location.href = 'index.html'
            // alert('asdsaddada')
        } else {
            if (zhIpt == '') {
                // console.log(111);
                p1.style.display = 'block'
                iptDiv1.style.border = 'solid 1px red'
            } else {
                p1.style.display = 'none'
                iptDiv1.style.border = 'solid 1px blue'
                if (zhIpt.length < 3) {
                    p11.style.display = 'block'
                    iptDiv1.style.border = 'solid 1px red'
                } else {
                    p11.style.display = 'none'
                    iptDiv1.style.border = 'solid 1px blue'
                }
            }
            iptDiv1.style.border = 'solid 1px'
            if (pwd == '') {
                // console.log(111);
                p2.style.display = 'block'
                iptDiv2.style.border = 'solid 1px red'
            } else {
                p2.style.display = 'none'
                iptDiv2.style.border = 'solid 1px blue'
                if (pwd.length < 3) {
                    p22.style.display = 'block'
                    iptDiv2.style.border = 'solid 1px red'
                } else {
                    p22.style.display = 'none'
                    iptDiv2.style.border = 'solid 1px blue'
                }
            }
            iptDiv2.style.border = 'solid 1px'
        }

    }


}
ccc()

// --------------手机验证--------------
function ddd() {
    var ipDiv1 = document.getElementsByClassName('ip-box')[0]
    var ipDiv2 = document.getElementsByClassName('ip-box2')[0]
    var ipIpt = document.getElementsByClassName('inp1')[1]
    var ippwd = document.getElementsByClassName('inp2')[1]
    var p3 = document.getElementsByClassName('p3')[0]
    var p4 = document.getElementsByClassName('p4')[0]
    var p33 = document.getElementsByClassName('p33')[0]
    var dl = document.getElementsByClassName('ip-dl')[0]
    var myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
    ipIpt.onfocus = function () {
        ipDiv1.style.border = 'solid 1px blue'
    }
    ipIpt.onkeyup = function () {
        let zhIpt = document.getElementsByClassName('inp1')[1].value
        let zero = document.getElementsByClassName('zero')[1]
        if (zhIpt == '') {
            p3.style.display = 'block'
            ipDiv1.style.border = 'solid 1px red'
        } else {
            zero.innerHTML = zhIpt.length
        }
    }
    ipIpt.onblur = function () {
        let zhIpt = document.getElementsByClassName('inp1')[1].value
        if (zhIpt == '') {
            // console.log(111);
            p3.style.display = 'block'
            ipDiv1.style.border = 'solid 1px red'
        } else {
            p3.style.display = 'none'
            ipDiv1.style.border = 'solid 1px blue'
            if (zhIpt.length < 3) {
                p33.style.display = 'block'
                ipDiv1.style.border = 'solid 1px red'
            } else {
                if (!myreg.test(zhIpt)) {
                    p33.style.display = 'block'
                    ipDiv1.style.border = 'solid 1px red'
                } else {
                    p33.style.display = 'none'
                    ipDiv1.style.border = 'solid 1px blue'
                }
            }
        }
        ipDiv1.style.border = 'solid 1px'
    }

    ippwd.onfocus = function () {
        ipDiv2.style.border = 'solid 1px blue'
    }

    ippwd.onblur = function () {
        let pwd = document.getElementsByClassName('inp2')[1].value
        if (pwd == '') {
            // console.log(111);
            p4.style.display = 'block'
            ipDiv2.style.border = 'solid 1px red'
        } else {
            p4.style.display = 'none'
            ipDiv2.style.border = 'solid 1px blue'
            if (pwd.length < 4) {
                p4.style.display = 'block'
                ipDiv2.style.border = 'solid 1px red'
            } else {
                p4.style.display = 'none'
                ipDiv2.style.border = 'solid 1px blue'
            }
        }
        ipDiv2.style.border = 'solid 1px'
    }

    dl.onclick = function () {
        let zhIpt = document.getElementsByClassName('inp1')[1].value
        if (zhIpt == '') {
            // console.log(111);
            p3.style.display = 'block'
            ipDiv1.style.border = 'solid 1px red'
        } else {
            p3.style.display = 'none'
            ipDiv1.style.border = 'solid 1px blue'
            if (zhIpt.length < 3) {
                p33.style.display = 'block'
                ipDiv1.style.border = 'solid 1px red'
            } else {
                p33.style.display = 'none'
                ipDiv1.style.border = 'solid 1px blue'
            }
        }
        ipDiv1.style.border = 'solid 1px'
        let pwd = document.getElementsByClassName('inp2')[1].value
        if (pwd == '') {
            // console.log(111);
            p4.style.display = 'block'
            ipDiv2.style.border = 'solid 1px red'
        } else {
            p4.style.display = 'none'
            ipDiv2.style.border = 'solid 1px blue'
            if (pwd.length < 4) {
                p4.style.display = 'block'
                ipDiv2.style.border = 'solid 1px red'
            } else {
                p4.style.display = 'none'
                ipDiv2.style.border = 'solid 1px blue'
            }
        }
        ipDiv2.style.border = 'solid 1px'
    }

}
ddd()
// ---------------忘记密码二级页面---------------
function eee() {
    var sj = document.getElementsByClassName('dyg-ipt')[0]
    var dyg = document.getElementsByClassName('dyg-box')[0]
    var yzm = document.getElementsByClassName('deg-ipt')[0]
    var m1 = document.getElementsByClassName('ft-d1-ipt')[0]
    var m2 = document.getElementsByClassName('ft-d1-ipt2')[0]
    var p5 = document.getElementsByClassName('p5')[0]
    var p55 = document.getElementsByClassName('p55')[0]
    var p6 = document.getElementsByClassName('p6')[0]
    var p7 = document.getElementsByClassName('p7')[0]
    var p77 = document.getElementsByClassName('p77')[0]
    var p8 = document.getElementsByClassName('p8')[0]
    var myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;

    sj.onfocus = function () {
        console.log(1111);
        dyg.style.border = 'solid 1px blue'
    }
    sj.onkeyup = function () {
        let zhIpt = document.getElementsByClassName('dyg-ipt')[0].value
        let zero = document.getElementsByClassName('zero')[2]
        if (zhIpt == '') {
            p5.style.display = 'none'
            dyg.style.border = 'solid 1px blue'
        } else {
            zero.innerHTML = zhIpt.length
        }
    }
    sj.onblur = function () {
        let zhIpt = document.getElementsByClassName('dyg-ipt')[0].value
        if (zhIpt == '') {
            // console.log(111);
            p5.style.display = 'block'
            dyg.style.border = 'solid 1px red'
        } else {
            p5.style.display = 'none'
            dyg.style.border = 'solid 1px blue'
            if (zhIpt.length > 0 || zhIpt.length < 11) {
                p55.style.display = 'block'
                dyg.style.border = 'solid 1px red'
            } else {
                p55.style.display = 'none'
                if (!myreg.test(zhIpt)) {
                    p55.style.display = 'none'
                    dyg.style.border = 'solid 1px red'
                } else {
                    p55.style.display = 'block'
                    dyg.style.border = 'solid 1px blue'
                }
            }
        }
        dyg.style.border = 'solid 1px'
    }

    yzm.onfocus = function () {
        yzm.style.border = 'solid 1px blue'
    }

    yzm.onblur = function () {
        let pwd = document.getElementsByClassName('deg-ipt')[0].value
        if (pwd == '') {
            // console.log(111);
            p6.style.display = 'block'
            yzm.style.border = 'solid 1px red'
        } else {
            p6.style.display = 'none'
            yzm.style.border = 'solid 1px blue'
            if (pwd.length < 4) {
                p6.style.display = 'block'
                yzm.style.border = 'solid 1px red'
            } else {
                p6.style.display = 'none'
                yzm.style.border = 'solid 1px blue'
            }
        }
        yzm.style.border = 'solid 1px'
    }

    m1.onblur = function () {
        let pwd = document.getElementsByClassName('ft-d1-ipt')[0].value
        if (pwd == '') {
            // console.log(111);
            p7.style.display = 'block'
            m1.style.border = 'solid 1px red'
        } else {
            p7.style.display = 'none'
            m1.style.border = 'solid 1px blue'
            if (pwd.length < 6) {
                p77.style.display = 'block'
                m1.style.border = 'solid 1px red'
            } else {
                p77.style.display = 'none'
                m1.style.border = 'solid 1px blue'
            }
        }
        m1.style.border = 'solid 1px'
    }

    m2.onblur = function () {
        let m1 = document.getElementsByClassName('ft-d1-ipt')[0].value
        let pwd = document.getElementsByClassName('ft-d1-ipt2')[0].value
        if (pwd == '') {
            // console.log(111);
            p8.style.display = 'block'
            m2.style.border = 'solid 1px red'
        } else {
            p8.style.display = 'none'
            m2.style.border = 'solid 1px blue'
            if (pwd != m1) {
                p8.style.display = 'block'
                m2.style.border = 'solid 1px red'
            } else {
                p8.style.display = 'none'
                m2.style.border = 'solid 1px blue'
            }
        }
        m2.style.border = 'solid 1px'
    }

}
eee()
